#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstring>
using namespace std;
const int N = 2010;
double g[N][N];
bool st[N];
double dist[N];
int n, m;
int start, ed;
void dijkstra()
{
    dist[start] = 1;
    for (int i = 1; i <= n; i++)
    {
        int t = -1;
        for (int j = 1; j <= n; j++)
        {
            if (!st[j] && (t == -1 || dist[j] > dist[t])) t = j;
        }
        st[t] = true;
        for (int j = 1; j <= n; j++)
        {
            dist[j] = max(dist[j], dist[t] * g[t][j]);
        }
    }
}
int main()
{
    cin >> n >> m;
    for (int i = 0; i < m; i++)
    {
        int a, b, z;
        scanf("%d%d%d", &a, &b, &z);
        double c = (100.0 - z) / 100;
        g[a][b] = g[b][a] = max(g[a][b], c);
    }
    cin >> start >> ed;
    dijkstra();
    printf("%.8lf\n", 100 / dist[ed]);
}